﻿using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
using KlavoNotifications.Fetch;

namespace KlavoNotifications.Views
{
    public class GameTypeToColorConverter : IValueConverter
    {
        #region Implementation of IValueConverter

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            GameType type = (GameType)value;
            switch (type)
            {
                case GameType.Normal:
                    return new SolidColorBrush(Color.FromRgb(0, 0, 0));
                case GameType.Abra:
                    return new SolidColorBrush(Color.FromRgb(61, 72, 86));
                case GameType.Referats:
                    return new SolidColorBrush(Color.FromRgb(105, 135, 37));
                case GameType.NoErrors:
                    return new SolidColorBrush(Color.FromRgb(70, 146, 170));
                case GameType.Marathon:
                    return new SolidColorBrush(Color.FromRgb(212, 62, 125));
                case GameType.Chars:
                    return new SolidColorBrush(Color.FromRgb(181, 89, 0));
                case GameType.Digits:
                    return new SolidColorBrush(Color.FromRgb(119, 119, 119));
                case GameType.Sprint:
                    return new SolidColorBrush(Color.FromRgb(131, 63, 58));
                case GameType.CustomVoc:
                    return new SolidColorBrush(Color.FromRgb(134, 154, 208));
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}